package com.chinasoft.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


@Component
@Aspect
@Order(2)
public class AOPAdvice2 {

//    @Before("AOPPointCut.pt1()")
//    public void before(){
//        System.out.println("before ... ");
//    }
//
//    @After("AOPPointCut.pt1()")
//    public void after(){
//        System.out.println("after ... ");
//    }
//
//    @AfterReturning("AOPPointCut.pt1()")
//    public void afterReturning(){
//        System.out.println("AfterReturning ... ");
//    }
//
//    @AfterThrowing("AOPPointCut.pt1()")
//    public void afterThrowing(){
//        System.out.println("afterThrowing ... ");
//    }

    @Around("AOPPointCut.pt1()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("around  before ... ");
        Object ret = pjp.proceed();
        System.out.println("around  after ... ");
        return ret;
    }

}